import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitDataStruct = itf({
    payload: itf({
        brands: [itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
        }))],
        isDealerUser: 'boolean',
    })
});

const content = {
    id: 'string',
    code: 'string',
    brandCode: 'string? | null',
    brandName: 'string? | null',
    dealerCode: 'string? | null',
    dealerName: 'string? | null',
    invoiceCode: 'string? | null',
    invoicedDate: 'datetime? | null',
    status: 'number? | null',
    claimType: 'number? | null',
    paymentMethod: 'number? | null',
    currency: 'number? | null',
    claimFee: 'number? | null',
    claimAmount: 'number? | null',
    rowVersion: 'string? | null',
    options: ['string'],
};

export const List = itf({
    payload: itf({
        content: [itf(Object.assign(content))]
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        partClaimId: 'string',
        branchCode: 'string?|null',
        branchName: 'string?|null',
        brandCode: 'string?|null',
        brandName: 'string?|null',
        dealerCode: 'string?|null',
        dealerName: 'string?|null',
        code: 'string?|null',
        status: 'number?|null',
        claimCode: 'string?|null',
        createTime: 'string?|null',
        invoiceCode: 'string?|null',
        invoicedDate: 'string?|null',
        claimType: 'number?|null',
        receiptDate: 'string?|null',
        currency: 'number?|null',
        mgmtRate: 'number?|null',
        shipmentDate: 'string?|null',
        actualArrivalDate: 'string?|null',
        destination: 'string?|null',
        claimAmount: 'number?|null',
        totalFee: 'number?|null',
        address: 'string?|null',
        contactNumber: 'string?|null',
        surveyResults: 'string?|null',
        preventMeasures: 'string?|null',
        treatmentScheme: 'number?|null',
        payType: 'string?|null',
        cacuStatus: 'number?|null',
        createName: 'string?|null',
        operateTime: 'string?|null',
        operateName: 'string?|null',
        confirmorName: 'string?|null',
        confirmTime: 'string?|null',
        rowVersion: 'string',
        options: 'array',
        partClaimReportDetail: [
            itf({
                partId: 'string',
                packingListCode: 'string?|null',
                partSaleOrderCode: 'string?|null',
                partCode: 'string',
                partName: 'string',
                claimAmount: 'number?|null',
                price: 'number?|null',
                claimFee: 'number?|null',
                fobAmount: 'number?|null',
                mgmtFee: 'number?|null',
                totalAmount: 'number?|null',
                claimReason: 'number?|null',
                claimResult: 'number?|null'
            })
        ]
    })
});
export const PartInvoice = itf({
    payload: itf({
        content: [
            itf(Object.assign({
                id: 'string',
                code: 'string',
                brandCode: 'string? | null',
                dealerCode: 'string? | null',
                destination: 'string? | null',
                invoicedDate: 'datetime? | null',
                shipmentDate: 'datetime? | null',
                actualArrivalDate: 'datetime? | null',
                details: [
                    itf({
                        partId: 'string',
                        partCode: 'string',
                        partName: 'string',
                        packingListCode: 'string? | null',
                        partSaleOrderCode: 'string? | null',
                        quantity: 'number? | null',
                        price: 'number? | null',
                        claimReason: 'number',
                    })
                ]
            }))
        ]
    })
});
